<?php

namespace app\base\controller\api;

use think\admin\Controller;
use app\base\model\Notice as NoticeModel;
use app\base\controller\api\Auth;


/**
 * 登陆
 * Class Login
 * @package app\store\controller
 */
class Notice extends Auth
{
    public function getList()
    {
       $list = NoticeModel::mQuery()->where('is_deleted', 0)->like('tile')->order('id desc')->page(true, false);
       $this->success('获取成功', $list);

    }
    public function getInfo()
    {
        $data = NoticeModel::mk()->find(input('id'));
        if(isset($data['attachment'])){
            $data['attachment'] = json_decode($data['attachment'],true);
            $data['attachment_num'] = count($data['attachment']);
        }
        $this->success('获取成功', $data);

    }
}